/**
 * shift() 方法删除指定元素的开头元素
 * unshift() 方法将指定元素添加到数组的开头，并返回数组的新长度
 */


const array1 = [1, 2, 3];

const firstElement = array1.shift();

console.log(array1);
// Expected output: Array [2, 3]

console.log(firstElement);
// Expected output: 1


const array2 = [1, 2, 3];

console.log(array2.unshift(4, 5));
// Expected output: 5

console.log(array2);
// Expected output: Array [4, 5, 1, 2, 3]
